<template>
    <div>
        <!-- 标题 -->
        <navtitle title="详情"></navtitle>
        <!-- 轮播图 -->
        <swipe :images="images" width="100%" height="150px"></swipe>
        <div v-html="detailApiData.goods_introduce"></div>
        <van-action-bar>
            <van-action-bar-icon icon="chat-o" text="客服" dot />
            <van-action-bar-icon icon="cart-o" text="购物车" badge="5" />
            <van-action-bar-icon icon="shop-o" text="店铺" badge="12" />
            <van-action-bar-button type="warning" text="加入购物车" />
            <van-action-bar-button type="danger" text="立即购买" />
        </van-action-bar>
    </div>
</template>

<script setup>
// 标题
import navtitle from '@/components/navtitle.vue';
// 轮播图
import swipe from '@/components/swipe.vue';
const images = [
    'https://fastly.jsdelivr.net/npm/@vant/assets/apple-4.jpeg',
    'https://fastly.jsdelivr.net/npm/@vant/assets/apple-5.jpeg',
];
import { useRoute } from 'vue-router';
const route = useRoute()
console.log(route.params.goods_id);

import { detailApi } from '@/api/api';
import { ref } from 'vue';
let detailApiData = ref([])
detailApi(route.params.goods_id).then((res) => {
    console.log(res);
    detailApiData.value = res.data.message
})
</script>

<style lang="scss" scoped></style>